package thread;

import java.sql.SQLOutput;
import java.util.Scanner;

public class SleepDemo {
    public static void main(String[] args) {
        /*Scanner input = new Scanner(System.in);
        int num = input.nextInt();
        for(int i = num-1; i>0;i--){
            try {
                Thread.sleep(1000L);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println(i);
        }
        System.out.println("时间到");
        System.out.println("程序开始了");
        try {
            Thread.sleep(1000L);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        System.out.println("程序结束了");*/
        Scanner input = new Scanner(System.in);
        System.out.println("请输入一个整数");
        int num = input.nextInt();
        for(;num>0;num--){
            System.out.println(num);
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
        System.out.println("时间到");
    }
}
